package com.rabbitmq;

import com.rain.search.SearchApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @auther 德哲
 * @date 2019/4/29 15:01.
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SearchApplication.class)
public class demo {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void testDirectModeQueue(){
        rabbitTemplate.convertAndSend("yuqing","你好啊，雨晴！");
    }

    @Test
    public void testFanOutModeQueue(){
        rabbitTemplate.convertAndSend("koko","","分列模式的练习！");
    }

}
